package com.tiantianfresh.admin.service.Impl;

import com.tiantianfresh.admin.service.OrderService;
import com.tiantianfresh.model.dao.OrderMapper;
import com.tiantianfresh.model.dao.OrderSpecificMapper;
import com.tiantianfresh.model.pojo.OrderAddress;
import com.tiantianfresh.model.pojo.OrderSpecific;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author FANGAO
 * @date 2021/12/13 - 下午 19:46
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    private OrderMapper orderMapper;
    @Resource
    private OrderSpecificMapper orderSpecificMapper;

    @Override
    public List<OrderAddress> queryOrderAddress(Integer stateid) {
        return orderMapper.queryOrderAddress(stateid);
    }

    @Override
    public List<OrderSpecific> queryOrderSpecific(String orderid) {
        return orderSpecificMapper.queryOrderSpecific(orderid);
    }

    @Override
    public boolean updateOrderState(Map<String,Object> map) {
        map.put("orderState",3);
        if(orderMapper.updateOrderState(map)>0) return true;
        return false;
    }
}
